package com.cskaoyan.controller.wx.footprint;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.wx.footprint.FootprintListVo;
import com.cskaoyan.service.wx.footprint.WxFootprintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: bwj
 * @Date: 2022/09/10/10:39
 * @Description:
 */
@RestController
@RequestMapping("wx/footprint")
public class WxFootprintController {
    @Autowired
    WxFootprintService footprintService;

    /**
     * @Author: 宾文杰 @Description: 展示全部足迹信息 @Date: 2022/9/10
     */
    @RequestMapping("list")
    public BaseRespVo<FootprintListVo> footprintList(Integer page, Integer limit) {
        FootprintListVo footprintListVo = footprintService.list(page, limit);
        return BaseRespVo.ok(footprintListVo);
    }

    /**
    * @Author: 宾文杰 @Description: 足迹删除 @Date: 2022/9/11
    */
    @RequestMapping("delete")
    public BaseRespVo<String> footprintDelete(@RequestBody Map<String,Integer> map){
        Integer id = map.get("id");
        footprintService.delete(id);
        return BaseRespVo.ok(null);
    }

}
